from flask import Flask
from flask import render_template

from flask_sqlalchemy import SQLAlchemy

app = Flask(__name__)
app.config.from_object('config')

db = SQLAlchemy(app)

@app.errorhandler(404)
def not_found(error):
    #print "Pagina no encontrada"
    return render_template('404.html')

from app.controllers.acceso_controller import mod as accesoModule
from app.controllers.entidad_controller import mod as entidadesModule
 
from app.controllers.usuario_controller import mod as usuariosModule
from app.controllers.rol_controller import mod  as rolesModule
  
from app.controllers.fase_controller import mod  as fasesModule
from app.controllers.permiso_controller import mod as permisosModules
from app.controllers.comite_de_cambio_controller import mod as comitesModule

from app.controllers.proyecto_controller import mod as proyectosModule
from app.controllers.atributo_controller import mod as atributosModule

from app.controllers.item_controller import mod as itemsModule
from app.controllers.relacion_controller import mod as relacionesModule
from app.controllers.linea_base_controller import mod as lineasbaseModule
from app.controllers.tipoItem_controller import mod as tipoItemsModule

from app.controllers.atributo_item_controller import mod as atributoItemModule
from app.controllers.solicitud_cambio_controller import mod as solicitudCambioModule
from app.controllers.voto_controller import mod as votoModule

from app.controllers.calculo_impacto_controller import mod as impactoModule

from app.controllers.grafico_controller import mod as graficoModule

app.register_blueprint(accesoModule)
app.register_blueprint(entidadesModule)

app.register_blueprint(usuariosModule)
app.register_blueprint(rolesModule)
app.register_blueprint(fasesModule)
app.register_blueprint(permisosModules)
app.register_blueprint(comitesModule)

app.register_blueprint(proyectosModule)
app.register_blueprint(atributosModule)

app.register_blueprint(itemsModule)
app.register_blueprint(relacionesModule)
app.register_blueprint(lineasbaseModule)
app.register_blueprint(tipoItemsModule)
app.register_blueprint(atributoItemModule)
app.register_blueprint(solicitudCambioModule)
app.register_blueprint(votoModule)

app.register_blueprint(impactoModule)

app.register_blueprint(graficoModule)

